package com.ruoyi.web.controller.dispatch;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.DispatchActualPressureDecayValues;
import com.ruoyi.system.service.IDispatchActualPressureDecayValuesService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 实际压力衰减值Controller
 * 
 * @author ruoyi
 * @date 2025-03-02
 */
@RestController
@RequestMapping("/system/dispatchActualPressureDecayValues")
public class DispatchActualPressureDecayValuesController extends BaseController
{
    @Autowired
    private IDispatchActualPressureDecayValuesService dispatchActualPressureDecayValuesService;

    /**
     * 查询实际压力衰减值列表
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchActualPressureDecayValues:list')")
    @GetMapping("/list")
    public TableDataInfo list(DispatchActualPressureDecayValues dispatchActualPressureDecayValues)
    {
        startPage();
        List<DispatchActualPressureDecayValues> list = dispatchActualPressureDecayValuesService.selectDispatchActualPressureDecayValuesList(dispatchActualPressureDecayValues);
        return getDataTable(list);
    }

    /**
     * 导出实际压力衰减值列表
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchActualPressureDecayValues:export')")
    @Log(title = "实际压力衰减值", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DispatchActualPressureDecayValues dispatchActualPressureDecayValues)
    {
        List<DispatchActualPressureDecayValues> list = dispatchActualPressureDecayValuesService.selectDispatchActualPressureDecayValuesList(dispatchActualPressureDecayValues);
        ExcelUtil<DispatchActualPressureDecayValues> util = new ExcelUtil<DispatchActualPressureDecayValues>(DispatchActualPressureDecayValues.class);
        util.exportExcel(response, list, "实际压力衰减值数据");
    }

    /**
     * 获取实际压力衰减值详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchActualPressureDecayValues:query')")
    @GetMapping(value = "/{actualPressureDecayValuesId}")
    public AjaxResult getInfo(@PathVariable("actualPressureDecayValuesId") Long actualPressureDecayValuesId)
    {
        return success(dispatchActualPressureDecayValuesService.selectDispatchActualPressureDecayValuesByActualPressureDecayValuesId(actualPressureDecayValuesId));
    }

    /**
     * 新增实际压力衰减值
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchActualPressureDecayValues:add')")
    @Log(title = "实际压力衰减值", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DispatchActualPressureDecayValues dispatchActualPressureDecayValues)
    {
        return toAjax(dispatchActualPressureDecayValuesService.insertDispatchActualPressureDecayValues(dispatchActualPressureDecayValues));
    }

    /**
     * 修改实际压力衰减值
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchActualPressureDecayValues:edit')")
    @Log(title = "实际压力衰减值", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DispatchActualPressureDecayValues dispatchActualPressureDecayValues)
    {
        return toAjax(dispatchActualPressureDecayValuesService.updateDispatchActualPressureDecayValues(dispatchActualPressureDecayValues));
    }

    /**
     * 删除实际压力衰减值
     */
    @PreAuthorize("@ss.hasPermi('system:dispatchActualPressureDecayValues:remove')")
    @Log(title = "实际压力衰减值", businessType = BusinessType.DELETE)
	@DeleteMapping("/{actualPressureDecayValuesIds}")
    public AjaxResult remove(@PathVariable Long[] actualPressureDecayValuesIds)
    {
        return toAjax(dispatchActualPressureDecayValuesService.deleteDispatchActualPressureDecayValuesByActualPressureDecayValuesIds(actualPressureDecayValuesIds));
    }
}
